﻿//
// Copyright (c) 2024 BPer
//
#ifndef BPERPLAYER_SRC_BPERAUDIOPLAYALSA_H_
#define BPERPLAYER_SRC_BPERAUDIOPLAYALSA_H_

#include <bperaudiodev/BPerAudioPlay.h>

#if BPer_OS_LINUX

#include <alsa/asoundlib.h>

class BPerAudioPlayLinux:public BPerAudioPlay{
public:
	BPerAudioPlayLinux(BPerAVInfo* avinfo,BPerSynBufferManager* streams);
	~BPerAudioPlayLinux();

    int init();



protected:
	void startLoop();
	void stopLoop();

private:
	 int32_t m_loops;

private:

    int32_t m_contextt;
	snd_pcm_t *m_handle;
	snd_pcm_uframes_t m_frames;


	void closeAudio();
	int32_t ret;

};
#endif

#endif /* BPERPLAYER_SRC_BPERAUDIOPLAYALSA_H_ */
